<?php

/**
* @current cmsadvice.php
* @author   LiuYang <liu_yang@haibao.com>
* @date 2017年2月8日 下午6:49:36
*/
namespace haibao\jiepai\model\data\advice;

class CmsAdvice extends \haibao\jiepai\model\data\Base{
    /**
     * 反馈类型，1.内容设计和体验，2.使用中的异常，3.纠纷举报等其他投诉
     */
    const TYPE_VIEW = 1;
    const TYPE_EXPECT = 2;
    const TYPE_REPORT = 3;
    /**
     * 1,安卓，2.苹果
     */
    const CLIENTPHONEOSTYPE_ANDROID = 1;
    const CLIENTPHONEOSTYPE_APPLE = 2;
    /**
     *0,未解决，1.已解决
     */
    const STATUS_NO=0;
    const STATUS_YES=1;
    
    public $UserID;
    
    public $Type;
    
    public $Content;
    /**
     * 内容打分,最高5分
     */
    public $Score1;
    /**
     * 美观打分
     */
    public $Score2;
    /**
     * 整体打分
     */
    public $Score3;
    /**
     * 用户手机型号
     */
    public $ClientPhone;
    /**
     * 用户手机系统版本
     */
    public $ClientPhoneOS;
    
    public $ClientPhoneOSType;
    /**
     * 街拍APP版本号
     */
    public $AppVersion;
    
    public $CreateTime;
    
    public $Status;
    
    public $Flag;

    public function __construct(){
        parent::__construct();
        
        $this->setColumnName('Id', 'AdviceID');
        $this->intField('UserID', 'UserID');
        $this->stringField('Type', 'Type');
        $this->stringField('Content', 'Content');
        $this->intField('Score1', 'Score1');
        $this->intField('Score2', 'Score2');
        $this->intField('Score3', 'Score3');
        $this->stringField('ClientPhone', 'ClientPhone');
        $this->stringField('ClientPhoneOS', 'ClientPhoneOS');
        $this->intField('ClientPhoneOSType', 'ClientPhoneOSType');
        $this->stringField('AppVersion', 'AppVersion');
        $this->dateField('CreateTime', 'CreateTime');
        $this->intField('Status', 'Status');
        $this->intField('Flag', 'Flag');
        
        $this->setTableName('cms_advice');
    }

    public static function getAdviceTypeMap($adviceType = ''){

        $arr = array(
            self::TYPE_VIEW => '【内容设计和体验】',
            self::TYPE_EXPECT => '【使用中的异常】',
            self::TYPE_REPORT => '【纠纷举报等其他投诉】',
        );

        if($adviceType && isset($arr[$adviceType])) return $arr[$adviceType];
        return $arr;
    }
}

